home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gekkan Dennou Club 147
/
Gekkan Dennou Club - 2000.8 Vol. 147 (Japan).7z
/
Gekkan Dennou Club - 2000.8 Vol. 147 (Japan) (Track 1).bin
/
tools
/
zmc3v078
/
zmc3v078.lzh
/
SRCSV078.LZH
/
68LIB.C
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-27
|
1KB
|
65 lines
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "config.h"
#include "etc.h"
#ifndef NOUSE68LIB
int stricmp(const char *s1, const char *s2);
char *strlwr(char *s);
#endif
#ifndef NOUSE68LIB
int stricmp(const char *s1, const char *s2) /* contributed by E.Tanaka, thanks! */
{
#ifdef UNIXY_OS
int Ch1, Ch2; /* pure string */
int ch1, ch2; /* lower'd string */
do {
Ch1 = *s1++;
Ch2 = *s2++;
ch1 = tolower(Ch1);
ch2 = tolower(Ch2);
if (ch1 != ch2) {
return (ch1 - ch2);
}
} while (Ch1 != '\0' || Ch2 != '\0');
#else
int Ch1, Ch2; /* pure string */
do {
int i;
for (i = 0; i < 2; i++) {
int k = iskanji(Ch1 = *s1++);
Ch2 = *s2++;
if (!k) {
Ch1 = tolower(Ch1);
Ch2 = tolower(Ch2);
}
if (Ch1 != Ch2) {
return (Ch1 - Ch2);
}
if (!k || Ch1 || Ch2) {
break;
}
}
} while (Ch1 || Ch2);
#endif
return 0;
}
char *strlwr(char *s) { /* contributed by Y.Wabiko, thanks! */
char *d = s;
do {
*s = tolower((char)*s);
} while (*s++);
return d;
}
#endif /* NOUSE68LIB */